package moxl.xpath;

import java.util.List;

import moxl.dom.MoxlNode;
import moxl.xpath.axes.InvalidAxisForNodeException;
import moxl.xpath.parser.XPathParserException;
import moxl.xpath.parser.types.XPathEvaluationException;

public class XPathQuery<T extends MoxlNode>
{
	private XPathParsedQuery<T> query;

	public XPathQuery(String query) throws XPathParserException
	{
		this.query = XPathHelper.compile(query);
	}

	public List<T> execute(MoxlNode node) throws InvalidAxisForNodeException, XPathEvaluationException
	{
		return query.execute(node);
	}

}
